package com.dobbinsoft.iotechn.device.mqtt.serializer;

import com.alibaba.fastjson.JSONObject;

import java.util.List;

/**
 * Description:
 * User: rize
 * Date: 2020/6/22
 * Time: 15:09
 */
public class IotMqttJsonSerializer implements IotMqttSerializer {

    @Override
    public <T> byte[] toBytes(T t) {
        return JSONObject.toJSONString(t).getBytes();
    }

    @Override
    public <T> byte[] toBytes(List<T> t) {
        return JSONObject.toJSONString(t).getBytes();
    }
}
